package com.yu.yupicture.common;

import com.yu.yupicture.exception.ErrorCode;

public class Result {
    public static <T> BaseReponse<T> success (T data){
        return new BaseReponse(0,data,"ok" );

    }

    public static <T> BaseReponse<T> failed (ErrorCode errorCode){
        return new BaseReponse(errorCode);
    }

    public static <T> BaseReponse<T> failed (ErrorCode errorCode,String  message){
        return new BaseReponse(errorCode, message);
    }
    public static <T> BaseReponse<T> failed (int code,String  message){
        return new BaseReponse(code, message);
    }
}
